Components
> Agents
> Mobility
> P2P Computing

Werner Van Belle

e-mail: werner.van.belle@vub.ac.be

Programming Technology Lab (PROG)

Departement Informatica (DINF)

Vrije Universiteit Brussel (VUB)

Components

Offer "The Solution" for

Embedded Systems

Real Time Systems

Concurrent Systems

Distributed Systems

Mobile Systems

Reusability

Processor speed up

...

Component View

Based upon

The Borg Mobile Multi Agent System
http://borg.rave.org/

Seescoa: Software Engineering for Embedded Systems using a Component Oriented Approach
http://www.cs.kuleuven.ac.be/cwis/research/distrinet/projects/SEESCOA/

Components ?

Have their own code & data space

Can send messages to other components by means of ports

Message sending is asynchronously

Reactive

Documented

Runtime

Tools to handle them

Component Documentation

XML description of the messages (syntactic)

MSC which describes the required and provided control flow (semantic)

Textual description which documents the usage

Synchronisation description (???)

Locking interface

Transaction interface

Quality of service

Timing constraints/ required & provided

Memory constraints/ required & provided

Runtime Environment

Handles messages

Offers a naming service

Schedules threads

Tool Support

Precompiler

Converts .component to .java

Allows extraction of MSC's from the code

Better documentation

Writing components

Use componentclass

Componentclass Httpd

{

public Httpd(String name)

{super(name);}

}

Ports

A port is an entry point in a component where messagesw are received and messages can be send over

Ports can be mapped upon other objects

Multiports allows multiple connections

componentclass Httpd

{

port a;

multiport b;

...

}

Handling Messages

The CS takes care of delivery, we only have to implement the messages Html, HtmlDone, GenerateHtml

The 'port' identifier is the port over which the message came

The 'inmessage' identifier is the message which came in

componentclass Httpd

{

message Html()

message HtmlDone()

message RespondTo()

}

Retrieving Arguments

Message methods doesn't take any parameters. To retrieve the arguments use the <> notation.

componentclass Httpd

{...

message Html()

{System.out.println(<Data>)}

...}

Sending Messages

To contact another component the Httpd can send a message to another component using the special .. Notation

...{...

message RespondTo()

{dispatcher(URL)..GenerateHtml(<Url:URL>);}

...}

Session Tracing

We can trace sessions by passing virtual information along with the >< notation

...{...

message RespondTo()

{dispatcher(URL)..GenerateHtml(

<Url:URL>,

>Socket:<Socket><);}

...}

Messages

Either

Actually copy them

When passing them by value make them read-only for sender and receiver

Messages should act as if they are passed by copy.

Summary

Processes -

Enforces loosely coupling & explicit documentation

Asynchronous -

Enforces the programmer to program differently

Ports -

Aliassing

Connectivity

Reactive -

Control-flow, behaviour decoupling

Advantages of Using a CS

Explicit Messsage Handling

Glue components can be written easily

Depending on the processor multiple threads can be used

Runtime Constraints can be checked

Scheduling can be domain-dependent

Debugging/Profiling plugins

Very light weight

A Simple Adaptor

componentclass adaptor

{

port left;

port right;

message handleMessage()

{

if (port==left)

right.sendMessage(inmessage);

else if (port==right)

right.sendMessage(inmessage);

}

}

Components
> Agents
> Mobility
> P2P Computing

author: Werner Van Belle

e-mail: werner.van.belle@vub.ac.be

Programming Technology Lab (PROG)

Departement Informatica (DINF)

Vrije Universiteit Brussel (VUB)

Why Mobility

Agents/Components

Follow the user as necessary (roaming)

Can represent the user (avatars)

Can migrate to faster places (load balancing)

Enables Remote Execution & Resource Access (accessibility)

Can replicate before or migrate when a host shuts down (persistency)

Application leasing (security)

Problems Of Mobility

Requires a running infrastructure

Strong Mobility

Routing

Language ?

Finding communication partners

Concurrency Problems

Communication partners can change at runtime

Security

Partial Failures

Components
> Agents
> Mobility
> P2P Computing

author: Werner Van Belle

e-mail: werner.van.belle@vub.ac.be

Programming Technology Lab (PROG)

Departement Informatica (DINF)

Vrije Universiteit Brussel (VUB)

Partial Failure

In normal computing

Resources can fail

The application can fail

In client server computing

Client can fail

Server can fail

Peer 2 peer computing

Every little component can fail

A Little Calculation

P = probability one component fails due to

A network error

An interface mismatch

A security failure

N = number of processes

Chance of application breakdown = N.P

Even if we could write bugfree components

The more components, the more difficult to write working software.

Problem statement

How can we

Write component which are fault tolerant towards their communication partners

Enhance the running infrastructure to add redundancy

Subtasks

Protection

Detection

Resolution

FTC: Protection

Components should always be in a valid state

Checking the consistency of every incomming message

Expected Set

Guarding commands

A small failure of a communication partner should lock out the communication partner

Components should be able to roll back to a certain marking point ! (roll back)

FTC: Detection

Components should be able to detect failure of other components

Timeouts

Semantic verification

Semantic verification by other component

Secure verification by trusted parties

Session tracing

FTC: Resolution

Components should have some kind of problem resolution strategy

Lock out faulty components

Find new partners and redo everything which was already done (roll forward)

Faul Tolerant Components: Feasable ?

Infrastructure Enhancements

Replicate CAOR (calculation and/or data)

Should be ATAP (as transaparant as possible)

Should be F (fast)

Infrastructure Enhancements

Replicate CAOR (calculation and/or data)

Should be ATAP (as transaparant as possible)

Should be F (fast)

2002-03-31T13:02:54